import request from '@/utils/request'

/**
 * 查询企业组织架构
 *
 */
export const reqGetDepartments = () => {
  return request({
    method: 'get',
    url: '/company/department'
  })
}

/**
 * 根据删除组织部门
 *
 */
export const reqDelDepartments = (id) => {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}

/**
 * 新增部门接口
 **/
export function reqAddDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

/**
 *根据id获取企业详情
 */
export const reqGetDepartAll = (id) => {
  return request({
    method: 'get',
    url: `/company/department/${id}`
  })
}

/**
 * 根据ID修改部门详情
 */
export const reqUpdateDepartments = (form) => {
  return request({
    method: 'put',
    url: `/company/department/${form.id}`,
    data: form
  })
}
